<?
include_once("../../database.php");
include_once("../../backend.php");
include_once("../../login_management.php");
session_start();
include_once('../../database.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/scoutingevent.dwt.php" codeOutsideHTMLIsLocked="false" -->
<head>
<link rel="stylesheet" type="text/css" href="../../scouting.css"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>Home | Event Setup | Team Spyder Scouting</title>
<!-- InstanceEndEditable -->
<!-- InstanceBeginEditable name="head" -->
<script language='javascript'>

</script>
<!-- InstanceEndEditable -->
</head>

<body>
<div class="main">
<div class="top"><l>
<a class="navigation" href="./index.php">Home</a> | 
<a class="navigation" href="./event.php">Event Management</a> | 
<a class="navigation" href="../index.php"> Admin </a> | 
<script type="text/javascript">
function LoadLogin()
{
var xmlhttp;
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    document.getElementById("content").innerHTML=xmlhttp.responseText;
    }
  }
xmlhttp.open("GET","login.php",true);
xmlhttp.send();
}
</script>

<?
if($logged_in)
{
	echo "<l> Welcome, " . $_SESSION['username'] . " </l>";
	echo "<a class=\"navigation\" href=\"./logout.php\">Log out</a>\n";
}
else
{
	echo "<l> You are not logged in. </l>";
	echo "<a class=\"navigation\" href=\"#\" onclick=\"LoadLogin()\">Log in</a>\n";
}

?>
</l>
</div>
<div class="content"><!-- InstanceBeginEditable name="Content" -->
<?
if($logged_in)
{
?>
<div id="target">
<h1>Administration center for Event Setup</h1>
<?
//echo "<p>Currently configured year: " . $_SESSION['year'] . "</p>\n";
echo "<p>Currently configured regional: " . $_SESSION['regional'] . "</p>\n";
//echo "<p>Currently configured competition: " . $_SESSION['competition'] . "</p>\n";
$q="SELECT * FROM scoutlogin";
$result=mysql_query($q);
$registeredusers=mysql_num_rows($result);
echo "<p>Currently registered users: " . $registeredusers . "</p>\n";
}
else
{
	displayLogin();
}
mysql_close();
?>
</div>
<!-- InstanceEndEditable -->
</div>
</div>

</body>
<!-- InstanceEnd --></html>
